﻿package control
{
    import cmd.*;
    import com.core.*;
    import com.sh.game.consts.*;
    import com.sh.game.control.*;
    import com.sh.game.display.*;
    import com.sh.game.global.*;
    import com.sh.game.net.*;
    import com.sh.game.util.*;
    import consts.*;
    import flash.display.*;
    import flash.events.*;
    import flash.geom.*;
    import flash.text.*;
    import flash.ui.*;
    import flash.utils.*;
    import manager.*;
    import morn.core.components.*;
    import morn.core.handlers.*;
    import plugin.bagN.*;
    import plugin.instance.*;
    import plugin.npcDialog.*;
    import plugin.social.consts.*;
    import plugin.ybstore.consts.*;
    import pluginfw.nio.*;
    import view.*;
    import view.controller.*;
    import view.message.*;
    import view.uilt.*;

    public class PluginControl extends ModuleControl
    {
        public var fuckTime:int = 0;
        public var textTimes:int = 0;
        private var _cfgtools:Object;
        private var _intotime:uint = 0;

        public function PluginControl(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override protected function open() : void
        {
            state = "open";
            if (this.module == null)
            {
                if (!this.isLoading)
                {
                    this.loadModule(null);
                }
            }
            else
            {
                this.module.visible = true;
            }
            return;
        }// end function

        override protected function close() : void
        {
            state = "close";
            if (this.module)
            {
                this.module.visible = false;
            }
            return;
        }// end function

        override protected function initModule() : void
        {
            this.module.install(target);
            if (this.state == "open")
            {
                this.module.visible = true;
            }
            else
            {
                this.module.visible = false;
            }
            return;
        }// end function

        public function keyDown(param1:Object) : void
        {
            var _loc_2:int = 0;
            var _loc_4:int = 0;
            var _loc_5:int = 0;
            var _loc_7:* = undefined;
            var _loc_9:Point = null;
            if (PluginManager.instance.getPluginState("death") == "open")
            {
                return;
            }
            if (PluginManager.instance.getPluginState("deathsbk") == "open")
            {
                return;
            }
            var _loc_3:* = ModelProxy.getValue("progress", "progressBar");
            if (_loc_3.visible)
            {
                return;
            }
            var _loc_6:Point = null;
            if (this.isFocus)
            {
                return;
            }
            if (param1.type == KeyboardEvent.KEY_DOWN)
            {
                return;
            }
            var _loc_8:String = "";
            switch(param1.keyCode)
            {
                case Keyboard.I:
                {
                    ModelProxy.change("plugin", "change", {target:"guanwei"});
                    break;
                }
                case Keyboard.G:
                {
                    _loc_8 = "shenlu";
                    break;
                }
                case Keyboard.T:
                {
                    break;
                }
                case Keyboard.C:
                {
                    _loc_8 = "role";
                    break;
                }
                case Keyboard.B:
                {
                    _loc_8 = "bag";
                    break;
                }
                case Keyboard.M:
                {
                    _loc_8 = "map";
                    break;
                }
                case Keyboard.S:
                {
                    _loc_8 = "skill";
                    break;
                }
                case Keyboard.J:
                {
                    _loc_7 = 1;
                    _loc_8 = "qianghua";
                    break;
                }
                case Keyboard.L:
                {
                    _loc_8 = "rank";
                    break;
                }
                case Keyboard.P:
                {
                    _loc_8 = "team";
                    break;
                }
                case Keyboard.F:
                {
                    _loc_8 = "social";
                    break;
                }
                case Keyboard.M:
                {
                    _loc_8 = "map";
                    break;
                }
                case Keyboard.O:
                {
                    _loc_8 = "systemset";
                    _loc_7 = 3;
                    break;
                }
                case Keyboard.V:
                {
                    _loc_8 = "store";
                    break;
                }
                case Keyboard.H:
                {
                    ModelProxy.change("mainui", "changepk", null);
                    break;
                }
                case Keyboard.G:
                {
                    _loc_2 = UserData.getUserData("level");
                    if (_loc_2 >= 16)
                    {
                        _loc_8 = "horse";
                    }
                    else
                    {
                        ItemUilt.ErrortipsForLevel(16);
                        return;
                    }
                    break;
                }
                case Keyboard.U:
                {
                    _loc_8 = "union";
                    break;
                }
                case Keyboard.N:
                {
                    _loc_2 = UserData.getUserData("level");
                    if (_loc_2 >= 44)
                    {
                        _loc_8 = "wing";
                    }
                    else
                    {
                        ItemUilt.ErrortipsForLevel(44);
                        return;
                    }
                    break;
                }
                case 27:
                {
                    PluginManager.instance.closeTop();
                    break;
                }
                default:
                {
                    break;
                }
            }
            if (_loc_8 != "")
            {
                _loc_9 = UIGlobel.pointsDic[_loc_8];
                if (_loc_9)
                {
                    if (_loc_7)
                    {
                        PluginManager.instance.changePlugin(_loc_8, new Point(_loc_9.x, _loc_9.y), _loc_7, _loc_6);
                    }
                    else
                    {
                        PluginManager.instance.changePlugin(_loc_8, new Point(_loc_9.x, _loc_9.y), null, _loc_6);
                    }
                }
                else if (_loc_7)
                {
                    PluginManager.instance.changePlugin(_loc_8, new Point(100, 100), _loc_7, _loc_6);
                }
                else
                {
                    PluginManager.instance.changePlugin(_loc_8, new Point(100, 100), null, _loc_6);
                }
            }
            return;
        }// end function

        private function doTime(event:MouseEvent = null) : void
        {
            var _loc_2:String = this;
            var _loc_3:* = this.textTimes + 1;
            _loc_2.textTimes = _loc_3;
            ModelProxy.change("chat", "addsysmsg", "测试:" + this.textTimes + "==>方宇是个小逗逼呀小逗逼......万能的jb......耶耶耶！");
            return;
        }// end function

        private function clip1CompleteHandler(param1:XMLMovieClip) : void
        {
            if (param1)
            {
                param1.x = 225;
                param1.y = -100;
                param1.interval = 120;
                param1.playFromTo(-1, (param1.totalFrame - 1), new Handler(this.moveCon, [param1]));
                GlobalLayer.instance.root.stage.addChild(param1);
            }
            return;
        }// end function

        private function moveCon(param1:XMLMovieClip) : void
        {
            if (param1.parent)
            {
                param1.parent.removeChild(param1);
                param1.dispose();
            }
            return;
        }// end function

        private function get isFocus() : Boolean
        {
            var _loc_1:* = GlobalLayer.instance.root.focus;
            if (_loc_1 is TextField)
            {
                return TextField(_loc_1).type == TextFieldType.INPUT;
            }
            if (_loc_1 is TextInput)
            {
                return TextInput(_loc_1).editable;
            }
            return false;
        }// end function

        override public function update(param1:Obproxy, param2:ProxyChange) : void
        {
            var hid:int;
            var aid:int;
            var data:Object;
            var str:String;
            var arr:Array;
            var obj:Object;
            var paramstr:String;
            var params:Array;
            var x:int;
            var _storeids:Array;
            var o:* = param1;
            var arg:* = param2;
            if (o.getName() == "plugin")
            {
                if (arg.property == "open")
                {
                    PluginManager.instance.openPlugin(String(arg.newvalue.target), arg.newvalue.point, arg.newvalue.data, arg.newvalue.top, arg.newvalue.limit);
                }
                else if (arg.property == "close")
                {
                    PluginManager.instance.closePlugin(String(arg.newvalue));
                }
                else if (arg.property == "change")
                {
                    PluginManager.instance.changePlugin(String(arg.newvalue.target), arg.newvalue.point, arg.newvalue.data, arg.newvalue.top);
                }
                else if (arg.property == "sendSysMsg")
                {
                    PluginManager.instance.sendMsg(arg.newvalue);
                }
                else if (arg.property == "updialog")
                {
                    PowerCheckControl.instance.check(arg.newvalue);
                }
                else if (arg.property == "closeFBDrop")
                {
                    DialogMgr.instance.close(AppDialog.FB_DROPS);
                }
                else if (arg.property == "itemlink")
                {
                    str = String(arg.newvalue);
                    arr = str.split("#");
                    if (arr[2])
                    {
                        this.openplugin(String(arr[0]), {gototype:int(arr[1]), newid:int(arr[2])});
                    }
                    if (arr[1] && arr[2] == null)
                    {
                        this.openplugin(String(arr[0]), int(arr[1]));
                    }
                    if (arr[0] && arr[1] == null && arr[2] == null)
                    {
                        this.openplugin(String(arr[0]));
                    }
                }
                else if (arg.property == "fire")
                {
                    obj = arg.newvalue;
                    if (obj.rid == UserData.getUserData("rid") && obj.intofuben == 1)
                    {
                        this._intotime = setTimeout(this.into, 0, obj.fubenid);
                    }
                }
                else if (arg.property == "fireflower")
                {
                }
                else if (arg.property == "zhaoji")
                {
                    PluginManager.instance.sendToServer("social", CMDSocial.TargetZhan, null);
                }
                else if (arg.property == "openfunc")
                {
                    DialogMgr.instance.open(AppDialog.OPEN_FUNC, int(arg.newvalue));
                }
                else if (arg.property == "closefbdrop")
                {
                    DialogMgr.instance.close(AppDialog.FB_DROPS);
                }
                else if (arg.property == "showmclient")
                {
                }
                else if (arg.property == "openBox")
                {
                    this.useItem(arg.newvalue.index);
                }
                else if (arg.property == "useitem")
                {
                    data = arg.newvalue;
                    if (data[4] && data[4].cls == 7)
                    {
                        paramstr = data[4].bufferparam;
                        if (paramstr != "")
                        {
                            params = paramstr.split("#");
                            if (params.length == 2)
                            {
                                if (params[0] == 5)
                                {
                                    Alert2.show("是否花费 " + MColor.getHMTL(params[1] + "元宝", 6) + "使用该道具" + " ", "", ["确定", "取消"], function (param1:int, param2:Object) : void
            {
                if (param1 == 0)
                {
                    if (data[4].cls == 7 && int(data[4].durable) != 1)
                    {
                        DialogMgr.instance.open(AppDialog.OPEN_LB, data);
                    }
                    else
                    {
                        useItem(data.index);
                    }
                }
                return;
            }// end function
            );
                                    return;
                                }
                                if (params[0] == 6)
                                {
                                    Alert2.show("是否花费 " + MColor.getHMTL(params[1] + "礼券", 6) + "使用该道具", "", ["确定", "取消"], function (param1:int, param2:Object) : void
            {
                if (param1 == 0)
                {
                    if (data[4].cls == 7 && int(data[4].durable) != 1)
                    {
                        DialogMgr.instance.open(AppDialog.OPEN_LB, data);
                    }
                    else
                    {
                        useItem(data.index);
                    }
                }
                return;
            }// end function
            );
                                    return;
                                }
                                if (params[0] == 7)
                                {
                                    Alert2.show("是否花费 " + MColor.getHMTL(params[1] + "金币", 6) + "使用该道具", "", ["确定", "取消"], function (param1:int, param2:Object) : void
            {
                if (param1 == 0)
                {
                    if (data[4].cls == 7 && int(data[4].durable) != 1)
                    {
                        DialogMgr.instance.open(AppDialog.OPEN_LB, data);
                    }
                    else
                    {
                        useItem(data.index);
                    }
                }
                return;
            }// end function
            );
                                    return;
                                }
                                if (params[0] == 9)
                                {
                                    ModelProxy.change("plugin", "change", {target:"qingtongbox", point:new Point(100, 100), data:data});
                                    return;
                                }
                            }
                        }
                    }
                    else if (data[4].cls == 2)
                    {
                        if (int(data[4].buffertype) == 26)
                        {
                            ModelProxy.change("plugin", "open", {target:"wing", data:data.index});
                        }
                        else if (int(data[4].buffertype) == 27)
                        {
                            ModelProxy.change("plugin", "open", {target:"horse", data:data.index});
                        }
                    }
                    else if (data[4].link == "chuansong")
                    {
                        x = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                        ModelProxy.change("plugin", "change", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(x, 100), data:{npcid:218, type:"deliver", pay:1}});
                    }
                    else if (data[4].cls == 25)
                    {
                        _storeids;
                        _storeids.push(data[4].buffertype);
                        PluginManager.instance.sendToServer("store", CMDStore.ItemPrice, {list:_storeids, type:6});
                        return;
                    }
                    if (data[4].cls == 7 && int(data[4].durable) != 1)
                    {
                        if (data[4].bufferparam == 8)
                        {
                            ModelProxy.change("plugin", "change", {target:"specialbox", point:new Point(100, 100), data:data});
                        }
                        else
                        {
                            DialogMgr.instance.open(AppDialog.OPEN_LB, data);
                        }
                    }
                    else
                    {
                        this.useItem(data.index);
                    }
                }
                else if (arg.property == "useitemall")
                {
                    data = arg.newvalue;
                    PluginManager.instance.sendToServer("bag", CMDBag.UseAllItem, data.index);
                }
                else if (arg.property == "opennpc")
                {
                    this.opennpc(arg.newvalue);
                }
            }
            else if (o.getName() == "key1")
            {
                if (arg.property == "keyDown1")
                {
                    this.keyDown(arg.newvalue);
                }
            }
            return;
        }// end function

        private function openplugin(param1:String, param2:Object = null) : void
        {
            var _loc_3:* = UIGlobel.pointsDic[param1];
            if (_loc_3)
            {
                if (param2)
                {
                    PluginManager.instance.openPlugin(param1, new Point(_loc_3.x, _loc_3.y), param2);
                }
                else
                {
                    PluginManager.instance.openPlugin(param1, new Point(_loc_3.x, _loc_3.y));
                }
            }
            else if (param2)
            {
                PluginManager.instance.openPlugin(param1, new Point(100, 100), param2);
            }
            else
            {
                PluginManager.instance.openPlugin(param1, new Point(GlobalLayer.instance.root.stageWidth - 300, 100));
            }
            return;
        }// end function

        private function opennpc(param1:Object) : void
        {
            var _loc_5:int = 0;
            var _loc_6:int = 0;
            var _loc_7:int = 0;
            var _loc_8:int = 0;
            var _loc_9:int = 0;
            var _loc_10:int = 0;
            var _loc_13:Object = null;
            var _loc_14:Output = null;
            var _loc_15:Object = null;
            var _loc_16:Object = null;
            var _loc_17:int = 0;
            var _loc_18:int = 0;
            var _loc_19:Object = null;
            var _loc_20:Object = null;
            var _loc_21:Object = null;
            var _loc_22:Object = null;
            var _loc_23:Object = null;
            var _loc_24:String = null;
            var _loc_25:Array = null;
            var _loc_26:Array = null;
            var _loc_27:Array = null;
            var _loc_28:Date = null;
            var _loc_29:Date = null;
            var _loc_30:Date = null;
            var _loc_2:* = param1.func;
            var _loc_3:* = param1.npcid;
            var _loc_4:* = param1.id;
            _loc_5 = param1.taskid;
            var _loc_11:* = GlobalLayer.instance.root;
            var _loc_12:* = param1.returnFunc;
            switch(_loc_2)
            {
                case "yaodian":
                case "wuqi":
                case "fangju":
                case "shiping":
                case "shudian":
                case "zahuo":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 750) / 2);
                    ModelProxy.change("plugin", "open", {target:"shop", point:UIGlobel.pointsDic["bag"], data:_loc_3, top:new Point(_loc_6, 100)});
                    ModelProxy.change("plugin", "open", {target:"bag", point:UIGlobel.pointsDic["bag"], top:new Point(_loc_6 + 374, 100)});
                    if (_loc_12 != null)
                    {
                        this._loc_12("bag", _loc_4);
                    }
                    if (_loc_12 != null)
                    {
                        this._loc_12("shop", _loc_4);
                    }
                    break;
                }
                case "sbkflag":
                {
                    _loc_14 = new Output();
                    Server.instance.sendBuffer(61, CMDSBK.ReqFlag, _loc_14.getBuffer(), 0, ConnectType.SYSTEM);
                    if (_loc_12 != null)
                    {
                        this._loc_12("sbkflag", _loc_4);
                    }
                    break;
                }
                case "taskdialog":
                {
                    _loc_15 = new Object();
                    _loc_15.npcid = _loc_3;
                    _loc_15.taskid = _loc_5;
                    _loc_16 = UserData.getData(UserDataType.Task);
                    _loc_17 = _loc_16["tid_" + _loc_5].state;
                    _loc_6 = int(GlobalLayer.instance.root.stageWidth / 2 + 80);
                    _loc_7 = int(GlobalLayer.instance.root.stageHeight / 2 - 320);
                    ModelProxy.change("plugin", "open", {target:"taskdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2 - 60, GlobalLayer.instance.root.stageHeight / 2 - 120), data:_loc_15, top:new Point(_loc_6, _loc_7)});
                    if (_loc_12 != null)
                    {
                        this._loc_12("taskdialog", _loc_4);
                    }
                    break;
                }
                case "cangku":
                {
                    _loc_10 = UserData.getUserData("level");
                    if (_loc_10 < 38)
                    {
                        ItemUilt.ErrortipsForLevel(38);
                        return;
                    }
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 740) / 2);
                    ModelProxy.change("plugin", "open", {target:"warehouse", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100)});
                    ModelProxy.change("plugin", "open", {target:"bag", point:UIGlobel.pointsDic["bag"], top:new Point(_loc_6 + 374, 100)});
                    if (_loc_12 != null)
                    {
                        this._loc_12("warehouse", _loc_4);
                    }
                    break;
                }
                case "fuben":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:"fuben"}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "chuanshuo":
                {
                    _loc_13 = ModelProxy.getValue("data", "user");
                    _loc_10 = _loc_13.level;
                    _loc_8 = _loc_13.rein;
                    if (_loc_8 <= 1)
                    {
                        if (!ItemUilt.checkUserLevelRein(70, 0))
                        {
                            ItemUilt.ErrortipsForLevel(70);
                            return;
                        }
                    }
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"superinstance", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:4});
                    if (_loc_12 != null)
                    {
                        this._loc_12("superinstance", _loc_4);
                    }
                    break;
                }
                case "baoku":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:"baoku"}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "shashop":
                {
                    ModelProxy.change("plugin", "open", {target:"jifenshop", point:UIGlobel.pointsDic["union"], data:4});
                    if (_loc_12 != null)
                    {
                        this._loc_12("jifenshop", _loc_4);
                    }
                    break;
                }
                case "qianghua":
                {
                    _loc_10 = UserData.getUserData("level");
                    if (_loc_10 < 50)
                    {
                        ItemUilt.ErrortipsForLevel(50);
                        return;
                    }
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"qianghua", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:1});
                    if (_loc_12 != null)
                    {
                        this._loc_12("qianghua", _loc_4);
                    }
                    break;
                }
                case "mobai":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"mobai", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:1});
                    if (_loc_12 != null)
                    {
                        this._loc_12("mobai", _loc_4);
                    }
                    break;
                }
                case "xiangqian":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"qianghua", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:3});
                    if (_loc_12 != null)
                    {
                        this._loc_12("qianghua", _loc_4);
                    }
                    break;
                }
                case "fumo":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"qianghua", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:2});
                    if (_loc_12 != null)
                    {
                        this._loc_12("qianghua", _loc_4);
                    }
                    break;
                }
                case "unionactivity":
                {
                    if (UserData.getUserData("unionid") == 0)
                    {
                        WarningManager.show(14);
                    }
                    else
                    {
                        ModelProxy.change("plugin", "open", {target:"union", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), data:3});
                    }
                    break;
                }
                case "huodongui":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"gameactive", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:1});
                    if (_loc_12 != null)
                    {
                        this._loc_12("gameactive", _loc_4);
                    }
                    break;
                }
                case "huodong":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:"huodong"}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "tdefense":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:"tafang"}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "hongming":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:"hongming"}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "gongcheng":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:"gongcheng"}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "shoucheng":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:"shoucheng"}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case NpcDialogType.RLhecheng:
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.RLhecheng}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case NpcDialogType.xianliangHCPL:
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.xianliangHCPL}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case NpcDialogType.shenzhuangHCPL:
                {
                    if (++int(ModelProxy.getValue("data", "openday")) < 7)
                    {
                        WarningManager.show(173);
                        return;
                    }
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.shenzhuangHCPL}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case NpcDialogType.RxhcPL:
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.RxhcPL}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "qianghuahecheng":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"qianghua", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:1});
                    if (_loc_12 != null)
                    {
                        this._loc_12("qianghua", _loc_4);
                    }
                    break;
                }
                case "zhuansheng":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"zhuanshen", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100)});
                    if (_loc_12 != null)
                    {
                        this._loc_12("zhuanshen", _loc_4);
                    }
                    break;
                }
                case "emsstart":
                {
                    _loc_19 = UserData.getData(UserDataType.Task);
                    _loc_20 = UserData.getOnlineData();
                    if (_loc_20.ems >= 2)
                    {
                        ModelProxy.change("movetips", "error", "今日护送次数已用完。");
                        return;
                    }
                    _loc_9 = Number(ModelProxy.getValue("data", "servertime") + getTimer()) / 1000;
                    if (_loc_21 && _loc_21[0] > 0 && _loc_21[1] == true && _loc_9 < _loc_21[2])
                    {
                        ModelProxy.change("movetips", "error", "您正在护送中");
                    }
                    else
                    {
                        _loc_22 = ConfigDictionary.data.gameactive;
                        _loc_9 = int((ModelProxy.getValue("data", "servertime") + Number(getTimer())) / 1000);
                        for each (_loc_23 in _loc_22)
                        {
                            
                            if (_loc_23.dietype == 4)
                            {
                                _loc_24 = _loc_23.time;
                                _loc_25 = _loc_24.split("-");
                                _loc_26 = (_loc_25[0] as String).split("#");
                                _loc_27 = (_loc_25[1] as String).split("#");
                                _loc_28 = new Date(_loc_9 * 1000);
                                _loc_29 = new Date(_loc_28.fullYear, _loc_28.month, _loc_28.date, int(_loc_26[0]), int(_loc_26[1]), 0, 0);
                                _loc_30 = new Date(_loc_28.fullYear, _loc_28.month, _loc_28.date, int(_loc_27[0]), int(_loc_27[1]), 0, 0);
                                if (_loc_9 >= _loc_29.time / 1000 && _loc_9 <= _loc_30.time / 1000)
                                {
                                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 740) / 2);
                                    ModelProxy.change("plugin", "open", {target:"ems"});
                                    if (_loc_12 != null)
                                    {
                                        this._loc_12("ems", _loc_4);
                                    }
                                    return;
                                    continue;
                                }
                                continue;
                            }
                        }
                        ModelProxy.change("movetips", "error", "不在活动时间");
                    }
                    break;
                }
                case "emsend":
                {
                    _loc_21 = ModelProxy.getValue("data", "ems");
                    if (_loc_21 && _loc_21[0] > 0 && _loc_21[1] == true)
                    {
                        _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                        ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:"ems"}});
                        if (_loc_12 != null)
                        {
                            this._loc_12("npcdialog", _loc_4);
                        }
                    }
                    break;
                }
                case "chuansong":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:"deliver"}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "cjshop":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:"des", opentype:2}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "jfshop":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:"des", opentype:1}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "rank":
                {
                    Server.instance.send(118, 10, _loc_3, 0, ConnectType.SYSTEM);
                    break;
                }
                case "chengzhu":
                {
                    Server.instance.send(118, 11, _loc_3, 0, ConnectType.SYSTEM);
                    break;
                }
                case "gonggao":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"gonggao", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100)});
                    if (_loc_12 != null)
                    {
                        this._loc_12("gonggao", _loc_4);
                    }
                    break;
                }
                case NpcDialogType.BOSS1:
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.BOSS1}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case NpcDialogType.BOSS2:
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.BOSS2}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case NpcDialogType.BOSSHOUSE3:
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.BOSSHOUSE3}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case NpcDialogType.MAYA2:
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.MAYA2}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case NpcDialogType.WEIZHIANDIAN:
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.WEIZHIANDIAN}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case NpcDialogType.BOSS4:
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.BOSS4}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case NpcDialogType.BOSS5:
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.BOSS5}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case NpcDialogType.BOSS6:
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.BOSS6}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case NpcDialogType.BOSS7:
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.BOSS7}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "shenweiyu":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.ShenWeiYu}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "jianta":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:"buildtf", id:_loc_4}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "superjianta":
                {
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(_loc_11.width / 2, _loc_11.height / 2 - 120), top:new Point((GlobalLayer.instance.root.stageWidth - 490) / 2, (GlobalLayer.instance.root.stageHeight - 300) / 2), data:{npcid:_loc_3, type:"buildsupertf", id:_loc_4}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "zhuangbeihuishou":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"zbhuishou", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100)});
                    if (_loc_12 != null)
                    {
                        this._loc_12("zbhuishou", _loc_4);
                    }
                    break;
                }
                case "chongji":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"welfare", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:null, data:1});
                    if (_loc_12 != null)
                    {
                        this._loc_12("welfare", _loc_4);
                    }
                    break;
                }
                case "yitianpidi":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"yitianpidi", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:4});
                    if (_loc_12 != null)
                    {
                        this._loc_12("yitianpidi", _loc_4);
                    }
                    break;
                }
                case "ronglian":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"zbhc", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100)});
                    if (_loc_12 != null)
                    {
                        this._loc_12("zbhc", _loc_4);
                    }
                    break;
                }
                case "guaji":
                {
                    ModelProxy.change("appdialog", "open", {dialogID:24, data:{npcid:_loc_3}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("appdialog", _loc_4);
                    }
                    break;
                }
                case "zssd":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.ZhuanShengShenDian}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "hj":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.HUANJING}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "hjtonext":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.HUANJINGTONEXT}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "hjquit":
                {
                    _loc_6 = int((GlobalLayer.instance.root.stageWidth - 700) / 2);
                    ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), top:new Point(_loc_6, 100), data:{npcid:_loc_3, type:NpcDialogType.HUANJINGQUIT}});
                    if (_loc_12 != null)
                    {
                        this._loc_12("npcdialog", _loc_4);
                    }
                    break;
                }
                case "juezhan":
                {
                    ModelProxy.change("plugin", "open", {target:_loc_2, point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120), limit:true});
                    if (_loc_12 != null)
                    {
                        this._loc_12("juezhan", _loc_4);
                    }
                    break;
                }
                case "csinstance":
                case "superinstance":
                {
                    _loc_13 = ModelProxy.getValue("data", "user");
                    _loc_10 = _loc_13.level;
                    _loc_8 = _loc_13.rein;
                    if (_loc_8 <= 1)
                    {
                        if (!ItemUilt.checkUserLevelRein(70, 0))
                        {
                            ItemUilt.ErrortipsForLevel(70);
                            return;
                        }
                    }
                    ModelProxy.change("plugin", "open", {target:_loc_2, point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120)});
                    if (_loc_12 != null)
                    {
                        this._loc_12(_loc_2, _loc_4);
                    }
                    break;
                }
                default:
                {
                    ModelProxy.change("plugin", "open", {target:_loc_2, point:new Point(GlobalLayer.instance.root.stageWidth / 2, GlobalLayer.instance.root.stageHeight / 2 - 120)});
                    if (_loc_12 != null)
                    {
                        this._loc_12(_loc_2, _loc_4);
                    }
                    break;
                    break;
                }
            }
            return;
        }// end function

        private function useItem(param1:int) : void
        {
            var itemBuffersarr:Array;
            var i:int;
            var cfgitem:Object;
            var param1:Array;
            var param2:Array;
            var index:* = param1;
            var bag:* = UserData.getBagData();
            if (bag[index])
            {
                ModelProxy.change("data", "changeid", bag[index][0]);
            }
            if (bag[index][4] && bag[index][4].cls == 8 && UserData.getUserData("mapid") != Constant.TUCHENGMAPID)
            {
                Alert2.show("只能在土城召唤BOSS", "", ["确认", "取消"], function (param1:int, param2:Object) : void
            {
                if (param1 == 0)
                {
                    PluginManager.instance.sendToServer("activity", CMDActivity.Trans, {x:17, y:132, tostageid:Constant.TUCHENGMAPID, free:1});
                }
                return;
            }// end function
            );
                return;
            }
            if (this._cfgtools == null)
            {
                this._cfgtools = ConfigDictionary.data.item;
            }
            if (!bag[index][4])
            {
                return;
            }
            var item:* = this._cfgtools[bag[index][4].itemid];
            var user:* = UserData.getUserData();
            var hasget:Boolean;
            if (user && user.hasOwnProperty("itemBuffersarr"))
            {
                itemBuffersarr = user.itemBuffersarr;
                i;
                while (i < itemBuffersarr.length)
                {
                    
                    cfgitem = this._cfgtools[itemBuffersarr[i]];
                    if (cfgitem == null)
                    {
                    }
                    else
                    {
                        param1 = String(item.bufferparam).split("#");
                        param2 = cfgitem.bufferparam.split("#");
                        if (cfgitem.buffertype == item.buffertype && cfgitem.buffertype != 1 && cfgitem.buffertype != 3)
                        {
                            if (param1[1] != param2[1])
                            {
                                hasget;
                                Alert2.show("您现在使用<font color =\'#53b436\'>" + item.name + "</font>，将替换掉当前生效的<font color =\'#53b436\'>" + cfgitem.name + "</font>的效果，是否确认替换？", "", ["确认", "取消"], function (param1:int, param2:Object) : void
            {
                if (param1 == 0)
                {
                    PluginManager.instance.sendToServer("bag", CMDBag.UseItem, index);
                }
                return;
            }// end function
            );
                                break;
                            }
                        }
                    }
                    i = (i + 1);
                }
            }
            if (!hasget)
            {
                PluginManager.instance.sendToServer("bag", CMDBag.UseItem, index);
            }
            return;
        }// end function

        private function into(param1:int) : void
        {
            if (this._intotime > 0)
            {
                clearTimeout(this._intotime);
                this._intotime = 0;
            }
            PluginManager.instance.sendToServer("instance", CMDInstance.NpcInstance, {mapid:param1});
            return;
        }// end function

    }
}
